package com.dingwen.treasure.model.entity.mybatisplus;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dingwen.treasure.base.enums.StatusEnum;
import com.dingwen.treasure.base.enums.SysConfigEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 系统配置表
 *
 * @author dingwen
 * @TableName sys_config
 * @date 2022/05/16
 */
@ApiModel(value = "sysConfig", description = "系统配置表")
@TableName(value = "sys_config")
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = true)
public class SysConfig extends BaseEntity {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 系统配置表自增主键
     */
    @ApiModelProperty(value = "系统配置ID，主键")
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 配置类型: 0: 系统配置 1: 业务配置
     */
    @ApiModelProperty(value = "配置类型: 0: 系统配置 1: 业务配置")
    private SysConfigEnum type;

    /**
     * 配置名称
     */
    @ApiModelProperty(value = "配置名称")
    private String name;

    /**
     * 配置Key
     */
    @ApiModelProperty(value = "配置code")
    private String code;

    /**
     * 配置Value
     */
    @ApiModelProperty(value = "配置Value")
    private String value;

    /**
     * 状态枚举 {@link StatusEnum}
     */
    @ApiModelProperty(value = "状态", dataType = "StatusEnum")
    private StatusEnum status;

    @Builder(toBuilder = true)
    public SysConfig(LocalDateTime createTime, LocalDateTime updateTime, Integer deleted, Integer version, String createBy, String updateBy, String remark, Integer id, SysConfigEnum type, String name, String code, String value, StatusEnum status) {
        super(createTime, updateTime, deleted, version, createBy, updateBy, remark);
        this.id = id;
        this.type = type;
        this.name = name;
        this.code = code;
        this.value = value;
        this.status = status;
    }
}